<?php

class SQLResult
{
	private $res;
	private $props;

	function __construct($res)
	{
		$this->res = $res;
	}

	function __get($k)
	{
		if (!isset($this->props[$k])) return null;
		return $this->props[$k];
	}

	function __set($k, $v)
	{
		$this->props[$k] = $v;
	}

	function fetch_hash()
	{
		return mysql_fetch_assoc($this->res);
	}

	function fetch_array()
	{
		return mysql_fetch_row($this->res);
	}

	function fetch_scalar()
	{
		$arr = $this->fetch_array();
		return $arr[0];
	}
}

?>
